#ifndef __OLED_H
#define __OLED_H
#include <stdio.h>

#define I2C_MASTER_SCL_IO 3         // I2C 主设备时钟线 GPIO 编号
#define I2C_MASTER_SDA_IO 4         // I2C 主设备数据线 GPIO 编号
#define I2C_MASTER_NUM 0            /*!< I2C 主设备 I2C 端口号，可用的 I2C 外设接口数量取决于芯片 */
#define I2C_MASTER_FREQ_HZ 40000    /*!< I2C 主设备时钟频率 */
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C 主设备不需要发送缓冲区 */
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C 主设备不需要接收缓冲区 */
#define I2C_MASTER_TIMEOUT_MS 1000  // I2C 主设备超时设置，单位：毫秒

#define OLED_ADDR 0x3C // OLED的从机地址
#define OLED_CMD 0     // 写命令
#define OLED_DATA 1    // 写数据

void OLED_ColorTurn(uint8_t i);
void OLED_DisplayTurn(uint8_t i);
void OLED_WR_Byte(uint8_t dat, uint8_t mode);
void OLED_DisPlay_On(void);
void OLED_DisPlay_Off(void);
void OLED_Refresh(void);
void OLED_Clear(void);
void OLED_DrawPoint(uint8_t x, uint8_t y, uint8_t t);
void OLED_DrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t mode);
void OLED_DrawCircle(uint8_t x, uint8_t y, uint8_t r);
void OLED_ShowChar(uint8_t x, uint8_t y, uint8_t chr, uint8_t size1, uint8_t mode);
void OLED_ShowString(uint8_t x, uint8_t y, char *chr, uint8_t size1, uint8_t mode);
void OLED_ShowNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len, uint8_t size1, uint8_t mode);
void OLED_ShowChinese(uint8_t x, uint8_t y, uint8_t num, uint8_t size1, uint8_t mode);
void OLED_ScrollDisplay(uint8_t num, uint8_t space, uint8_t mode);
void OLED_ShowPicture(uint8_t x, uint8_t y, uint8_t sizex, uint8_t sizey, uint8_t BMP[], uint8_t mode);
void OLED_Init(void);

#endif
